//
//  SiteTravelTableViewCell.m
//  BeanTrip
//
//  Created by dlios on 15-7-9.
//  Copyright (c) 2015年 PandaGroup. All rights reserved.
//

#import "SiteTravelTableViewCell.h"
#define WIDTH self.contentView.frame.size.width/375
#define HEIGHT self.contentView.frame.size.height/140
@implementation SiteTravelTableViewCell
- (void)dealloc
{
    [_siteImageView release];
    [_siteLabel release];
    [_siteLabel2 release];
    [_siteLabel3 release];
    [super dealloc];
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self=[super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.siteImageView = [[UIImageView alloc] init];
        [self.contentView addSubview:self.siteImageView];
        self.siteImageView.backgroundColor=[UIColor whiteColor];
        self.siteImageView.layer.masksToBounds=YES;
        self.siteImageView.layer.borderWidth=1;
        self.siteImageView.layer.cornerRadius=8;
        [_siteImageView release];
        
        self.siteLabel = [[UILabel alloc] init];
        self.siteLabel.numberOfLines = 0;
        self.siteLabel.font = [UIFont systemFontOfSize:18];;
        [self.contentView addSubview:self.siteLabel];
        [_siteLabel release];
        
        self.siteLabel2=[[UILabel alloc] init];
        [self.contentView addSubview:self.siteLabel2];
        self.siteLabel2.font = [UIFont systemFontOfSize:12];
        self.siteLabel2.numberOfLines = 2;
        [_siteLabel2 release];
        
        self.siteLabel3=[[UILabel alloc] init];
        [self.contentView addSubview:self.siteLabel3];
 
        self.siteLabel3.font = [UIFont systemFontOfSize:12];
        [_siteLabel3 release];
        
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.siteImageView.frame = CGRectMake(10*WIDTH, 0, (375*WIDTH*2)/5, 140*HEIGHT);
    
    self.siteLabel.frame = CGRectMake((375*WIDTH*2)/5+(20*WIDTH), 10*HEIGHT, 375*(WIDTH*3/5)-(30*WIDTH) , 30*HEIGHT);
    self.siteLabel2.frame = CGRectMake((375*WIDTH*2/5)+(20*WIDTH), 50*HEIGHT, (375*WIDTH*3/5)-(30*WIDTH) , 60*HEIGHT);
    self.siteLabel3.frame = CGRectMake((375*WIDTH*2/5)+(20*WIDTH), 120*HEIGHT, (375*WIDTH*3/5)-(30*WIDTH) , 20*HEIGHT);
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
